how to access array values by using a for loop json